package cn.lingyangwl.agile.system.model.rqrs.diy;

import cn.lingyangwl.agile.model.constants.*;
import cn.lingyangwl.agile.system.model.entity.*;
import cn.lingyangwl.framework.validation.group.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List;

/**
 * 表单
 *
 * @author shenguangyang
 */
@Getter
@Setter
public class DiyFormBase {
    @NotNull(message = ValidationCons.NOT_EMPTY, groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "表单标识")
    private String code;

    @ApiModelProperty(value = "表单字段")
    private List<DiyFormField> fieldList = Collections.emptyList();

    @NotNull(message = ValidationCons.NOT_EMPTY, groups = InsertGroup.class)
    private Long groupId;

    @ApiModelProperty(value = "数据源id")
    private Long datasourceId;

    @NotEmpty(message = ValidationCons.NOT_EMPTY, groups = InsertGroup.class)
    @ApiModelProperty(value = "表单名称")
    private String name;

    @ApiModelProperty(value = "表名")
    private String tableName;

    @NotEmpty(message = ValidationCons.NOT_EMPTY, groups = InsertGroup.class)
    @ApiModelProperty(value = "提交类型, 1 不限制 2 限填一次")
    private String submitType;

    @ApiModelProperty(value = "状态")
    private String status;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    private Integer sortNo;

    @ApiModelProperty(value = "表单配置")
    private String formConfig;

    @ApiModelProperty(value = "备注")
    private String remark;
}
